// components/song-menu-area/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    playlist: {
      type: Array,
      value: []
    },
    title: {
      type: String,
      value: ''
    },
    showRight: {
      type: Boolean,
      value: true
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleMenuItemClick: function (event) {
      const listId = event.currentTarget.dataset.item.id
      if (event.currentTarget.dataset.item.category) {
        const title = event.currentTarget.dataset.item.name
        wx.navigateTo({
          url:"../../pages/detail-songs/index?podcastId="+listId+"&title="+title
        })
      }else{
      wx.navigateTo({
        url: `../../pages/detail-songs/index?listId=${listId}`,
      })
      }
    },
    handleMoreClick(event) {
      let msg = ''
      if (event.currentTarget.dataset.title === "热门歌单") {
        msg = "popularSongList"
      } else if (event.currentTarget.dataset.title === "推荐歌单") {
        msg = "recommendSongList"
      }
      wx.navigateTo({
        url: `../../pages/song-list/index?msg=${msg}`,
      })
    }
  }
})
